#! /usr/bin/python
# -*- encoding: utf-8 -*-
"""
    Author: wanzhang
    Email: wanzhang@newtas.net
    Data: 2012-11-09
    Usage: WordCount process a file and get counting of  lines, chars and words
"""
import string
import sys

#count words/chars/lines
class WordCount:

    def get_line_count(self, filename):
        lines_count = 0
        file = open(filename,"r")
        for line in file.readlines():
             lines_count +=1
        return lines_count
 
    def get_char_count(self, filename):
        chars_count = 0
        file = open(filename,"r")
        for line in file.readlines():
            for char in line:
                chars_count +=1
        return chars_count

    def get_word_count(self, filename):
        words_count = 0
        file = open(filename,"r")
        for line in file.readlines():
            for word in line.split():
                words_count +=1
        return words_count


